﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using ElementumForever.Interfaces;

namespace ElementumForever.Editer
{
    public class ScenePropertyGridData : EntityPropertyGridData, ISceneProperty
    {
        BaseScene scene;
        public ScenePropertyGridData(BaseScene scene, MainFormModel model)
            : base(scene, model)
        {
            this.scene = scene;
        }

        protected override void Initialize()
        {
            base.Initialize();
            entity = new ScenePropertyProxy();
            scene = (BaseScene)entity;
        }

        [Browsable(false)]
        public override bool IsOriginCenter
        {
            get
            {
                return base.IsOriginCenter;
            }
            set
            {
                base.IsOriginCenter = value;
            }
        }

        [Browsable(false)]
        public override float X
        {
            get
            {
                return base.X;
            }
            set
            {
                base.X = value;
            }
        }

        [Browsable(false)]
        public override float Y
        {
            get
            {
                return base.Y;
            }
            set
            {
                base.Y = value;
            }
        }

        [Category("Center")]
        public float CenterX { get { return X; } set { X = value; } }
        [Category("Center")]
        public float CenterY { get { return Y; } set { Y = value; } }

        [Browsable(false)]
        public Microsoft.Xna.Framework.Vector2 Center
        { get; set; }

        [Category("Gravity")]
        public float GravityX
        {
            get
            {
                return scene.GravityX;
            }
            set
            {
                scene.GravityX = value;
            }
        }

        [Category("Gravity")]
        public float GravityY
        {
            get
            {
                return scene.GravityY;
            }
            set
            {
                GravityY = value;
            }
        }

        public bool HasPhysics
        {
            get
            {
                return scene.HasPhysics;
            }
            set
            {
                scene.HasPhysics = value;
            }
        }

        public float Zoom
        {
            get
            {
                return scene.Zoom;
            }
            set
            {
                scene.Zoom = value;
            }
        }
    }
}
